/*
Problem Description
　　给定一个m × n (m行, n列)的迷宫，迷宫中有两个位置，gloria想从迷宫的一个位置走到另外一个位置，
当然迷宫中有些地方是空地，gloria可以穿越，有些地方是障碍，她必须绕行，从迷宫的一个位置，只能走到与它相邻的4个位置中,
当然在行走过程中，gloria不能走到迷宫外面去。令人头痛的是，gloria是个没什么方向感的人，因此，她在行走过程中，
不能转太多弯了，否则她会晕倒的。我们假定给定的两个位置都是空地，初始时，gloria所面向的方向未定，
她可以选择4个方向的任何一个出发，而不算成一次转弯。gloria能从一个位置走到另外一个位置吗？
 

Input
　　第1行为一个整数t (1 ≤ t ≤ 100),表示测试数据的个数，接下来为t组测试数据，每组测试数据中，
　　第1行为两个整数m, n (1 ≤ m, n ≤ 100),分别表示迷宫的行数和列数，接下来m行，每行包括n个字符，
其中字符'.'表示该位置为空地，字符'*'表示该位置为障碍，输入数据中只有这两种字符，
每组测试数据的最后一行为5个整数k, x1, y1, x2, y2 (1 ≤ k ≤ 10, 1 ≤ x1, x2 ≤ n, 1 ≤ y1, y2 ≤ m),
其中k表示gloria最多能转的弯数，(x1, y1), (x2, y2)表示两个位置，其中x1，x2对应列，y1, y2对应行。
 

Output
　　每组测试数据对应为一行，若gloria能从一个位置走到另外一个位置，输出“yes”，否则输出“no”。
 

Sample Input
2
5 5
...**
*.**.
.....
.....
*....
1 1 1 1 3
5 5
...**
*.**.
.....
.....
*....
2 1 1 1 3
 

Sample Output
no
yes
 */
package com.yuan.algorithms.training20150807;

import java.io.*;
import java.util.*;

/**
 * @author YouYuan
 * @eMail E-mail:1265161633@qq.com
 * @Time 创建时间：2015年8月9日 上午9:49:52
 * @Explain 说明:
 */
class Node {
	int x, y, pre, count;

	Node(int x, int y, int pre, int count) {
		this.x = x;
		this.y = y;
		this.pre = pre;
		this.count = count;
	}
}

public class 广搜_逃离迷宫 {
	static int dir[][] = { { -1, 0 }, { 1, 0 }, { 0, 1 }, { 0, -1 } };
	static char map[][] = new char[105][105];
	static boolean hash[][] = new boolean[105][105];
	static int n, m, k;
	static PrintWriter cout = new PrintWriter(new OutputStreamWriter(System.out));

	/**
	 * 判断当前节点是否可走
	 * @param now
	 * @return
	 */
	static boolean index(Node now) {
		if (now.x >= 0 && now.x < n && now.y >= 0 && now.y < m
				&& now.count <= k && map[now.x][now.y] != '*')
			return true;
		return false;
	}

	static void BFS(int x1, int y1, int x2, int y2) {
		if (x1 == x2 && y1 == y2) {//判断是否到达终点
			cout.println("yes");
			cout.flush();
			return;
		}
		for (int i = 0; i <= n; i++)
			for (int j = 0; j <= m; j++)
				hash[i][j] = false;//初始化
		Queue<Node> Q = new LinkedList<Node>();
		Q.clear();//从队列中移除所有元素
		hash[x1][y1] = true;//标记
		for (int i = 0; i < 4; i++) {
			int tx = x1 + dir[i][0];
			int ty = y1 + dir[i][1];
			int tp = i;
			int tc = 0;
			Node next = new Node(tx, ty, tp, tc);
			if (!index(next))//判断下个节点是否可走
				continue;
			if (!hash[tx][ty]) {//判断下个节点是否没走过
				// cout.println(next.x + "  111 " + next.y + " " + next.count +
				// " " + next.pre);
				Q.add(next);
				hash[next.x][next.y] = true;
			}
			int xxx = x1;
			int yyy = y1;
			while (true) {
				tx = xxx + dir[i][0];
				ty = yyy + dir[i][1];
				tp = i;
				tc = 0;
				Node nex = new Node(tx, ty, tp, tc);
				if (index(nex)) {
					if (nex.x == x2 && nex.y == y2) {
						cout.println("yes");
						cout.flush();
						return;
					}
					// if(!hash[tx][ty])
					{
						Q.add(nex);
						hash[nex.x][nex.y] = true;
					}
				} else
					break;
				xxx = nex.x;
				yyy = nex.y;

			}
		}
		Node now = new Node(0, 0, 0, 0);
		while (!Q.isEmpty()) {
			now = Q.poll();
			// cout.println(now.x + " 222 " + now.y + " " + now.count + " " +
			// now.pre);
			if (now.x == x2 && now.y == y2) {
				cout.println("yes");
				cout.flush();
				return;
			}
			int xx = now.x;
			int yy = now.y;
			while (true) {
				int tx = xx + dir[now.pre][0];
				int ty = yy + dir[now.pre][1];
				int tp = now.pre;
				int tc = now.count;
				Node next = new Node(tx, ty, tp, tc);
				if (index(next)) {
					if (next.x == x2 && next.y == y2) {
						cout.println("yes");
						cout.flush();
						return;
					}
					if (!hash[tx][ty]) {
						Q.add(next);
						hash[next.x][next.y] = true;
					}
				} else
					break;
				xx = next.x;
				yy = next.y;

			}
			for (int i = 0; i < 4; i++) {
				if (i == now.pre)
					continue;
				int tx = now.x + dir[i][0];
				int ty = now.y + dir[i][1];
				int tp = i;
				int tc = now.count + 1;
				Node next = new Node(tx, ty, tp, tc);
				if (!index(next))
					continue;
				if (!hash[tx][ty]) {
					if (next.x == x2 && next.y == y2) {
						cout.println("yes");
						cout.flush();
						return;
					}
					Q.add(next);
					hash[tx][ty] = true;
				}
				xx = next.x;
				yy = next.y;
				int tp1 = next.pre;
				int tc1 = next.count;
				while (true) {
					tx = xx + dir[tp1][0];
					ty = yy + dir[tp1][1];
					tp = tp1;
					tc = tc1;
					Node nextt = new Node(tx, ty, tp, tc);
					if (index(nextt)) {
						if (nextt.x == x2 && nextt.y == y2) {
							cout.println("yes");
							cout.flush();
							return;
						}
						if (!hash[tx][ty]) {
							Q.add(nextt);
							hash[nextt.x][nextt.y] = true;
						}
					} else
						break;
					xx = nextt.x;
					yy = nextt.y;

				}

			}
		}
		cout.println("no");
		cout.flush();
		return;

	}

	public static void main(String[] args) {
		// StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new
		// InputStreamReader(System.in)));
		int t;
		Scanner in = new Scanner(System.in);
		t = in.nextInt();
		while (t-- > 0) {
			n = in.nextInt();
			m = in.nextInt();
			String s = new String();
			for (int i = 0; i < n; i++) {
				s = in.next();
				map[i] = s.toCharArray();
			}
			k = in.nextInt();
			int x1, y1, x2, y2;
			y1 = in.nextInt();
			y1--;
			x1 = in.nextInt();
			x1--;
			y2 = in.nextInt();
			y2--;
			x2 = in.nextInt();
			x2--;
			BFS(x1, y1, x2, y2);
		}

	}
}
